package com.example.student.util;

import com.example.student.entity.User;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;

/**
 * @author TonySong
 * @date 2025/8/8 0008
 * @time 11:08
 */
public class MyBeanUtil {

    public  static void copyProperties(User user, Map<String,String[]> map){
        try {
            BeanUtils.populate(user,map);
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
}
